#makefile
#author: Tobias Stein

#declarations
#compiler
CC=gcc
#compilerflags
CFLAGS=-std=c99 -pedantic -Wall -Wextra -g3
#sourceffiles (*.o)
SRC=fileHandling.o main.o conversion.o video.o coreFunction.o
#dependencies
DEB=macros.h prototypes.h typedefs.h

#generating program
all: imageToAscii

imageToAscii: $(SRC)
	$(CC) $(CFLAGS) -o imageToAscii $(SRC)

#building all *.o in dependency of their *.c-file and all headers
%.o: %.c $(DEB)
	$(CC) $(CFLAGS) -c $<

#cleaning command
ifeq ($(OS),Windows_NT)
clean:
	del imageToAscii.exe $(SRC)
	echo Done Cleaning
else
clean:
	rm -f imageToAscii *.o
	echo Done Cleaning
endif
